﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true"
    CodeFile="AddRoute.aspx.cs" Inherits="Admin_AddRoute" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div style="width: 100%">
        <h2 align="center">
            Add New Route</h2>
        From :
        <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource1"
            DataTextField="CityName" DataValueField="CityID" AutoPostBack="True">
        </asp:DropDownList>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:sqlString %>"
            SelectCommand="SELECT CityID, CAST([City Name] AS VARCHAR(50)) + ', ' + CAST(State AS VARCHAR(50)) + ', ' + CAST(Country AS VARCHAR(50)) AS CityName FROM Airline_Cities">
        </asp:SqlDataSource>
        <br />
        <br />
        To :
        <asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SqlDataSource2"
            DataTextField="CityName" DataValueField="CityID" AutoPostBack="True">
        </asp:DropDownList>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:sqlString %>"
            SelectCommand="SELECT CityID,
 CAST([City Name] AS VARCHAR(50))+',  '+
 CAST(State AS VARCHAR(50))+',  '+
 CAST(Country AS VARCHAR(50))
AS CityName
FROM Airline_Cities
WHERE
CityID NOT IN
(SELECT Airline_Cities_1.CityID  FROM Airline_Cities AS Airline_Cities_1 INNER JOIN Airline_Route ON Airline_Cities_1.CityID = Airline_Route.DestinationCityID WHERE (Airline_Route.OriginalCityID = @originID))
AND CityID &lt;&gt;  @originID">
            <SelectParameters>
                <asp:ControlParameter ControlID="DropDownList1" DefaultValue="0" Name="originID"
                    PropertyName="SelectedValue" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
        <br />
        Fly Hour : 
        <asp:TextBox ID="txtFlyHours" runat="server"></asp:TextBox>
        <br />
        <br />
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
            Text="Add New Route" />
        <br />
        <asp:Label ID="lblWarn" runat="server"></asp:Label>
    </div>
</asp:Content>
